package org.yray.sip.rtp.sender;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.socket.DatagramPacket;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.net.InetSocketAddress;

@Data
@AllArgsConstructor
public class FastSender {
    private Channel channel;
    private InetSocketAddress sender;

    public void send(byte[] bs)
    {
        ByteBuf byteBuf = Unpooled.copiedBuffer(bs);
        channel.writeAndFlush(new DatagramPacket(byteBuf, sender));
    }
}
